package edu.sctu.wujiayi.month06.day20150628.javaText;

import java.io.*;

/**
 * Created by user11 on 2015/6/28.
 */
public class FileOne {
   public  void fileDeal(String route) throws IOException {

       File file = new File(route);
       file.createNewFile();
       if (!file.exists()) {
           file.mkdir();
       }
   }


    public  JsonValueOne soDealFile() throws IOException {
        UrlPath url = new UrlPath();
        ThreadOne threadOne = new ThreadOne();
        String value = threadOne.threadunit(UrlPath.URL_PATH);
        FileOutputStream reader = new FileOutputStream(new File("D://Json//Appbean.txt"));
        reader.write(value.getBytes());

        String json = threadOne.threadunit(UrlPath.URL_PATH);
        JsonUnitOne jsonUnitOne = new JsonUnitOne(json);
        JsonValueOne jsonValueOne = jsonUnitOne.jsonValueOne;

        FileOutputStream fileStream = new FileOutputStream(new File("D://Json//Appbean.txt"));
        fileStream.write(json.getBytes());

        return jsonValueOne;
   }
}
